#ifndef __RING_SHM_H__
#define __RING_SHM_H__

namespace ring_shm
{

class RingSHM
{
public:
    static RingSHM* Create(const std::string& prefix,
        const size_t count, const size_t bytes) {}

    ~RingSHM()
    {
        while (m_list.size() > 0) {
            int fd = m_list.front();
            auto& name = m_records[fd];
            shm_unlink(name.c_str());
            m_list.pop_front();
        }
        delete this;
    }

    RingSHM(const RingSHM& shm) = delete;
    RingSHM(const RingSHM&& shm) {}
    
private:
    RingSHM(const std::string& prefix,
        const size_t count, const size_t bytes): m_prefix(prefix), m_count(count),
        m_list({}), m_records({}), m_bytes(bytes) {}
    
    std::string m_prefix;
    size_t m_count;
    size_t m_bytes;
    std::map<int, std::string> m_records;
    std::list<int> m_list;
}; // class RingSHM

} // namespace ring_shm

#endif // __RING_SHM_H__